#pragma once

#include "component/middleware/util/binio/binio.h"

struct TestStruct {
  int32_t n;
  ::component::middleware::util::binio::CString tag;
  uint8_t ipv4[4];
  struct {
    uint16_t major;
    uint16_t minor;
  } version;
};

namespace component::middleware::util::binio_test {

#include "component/middleware/util/binio_test/component.h"

using TestStruct = ::TestStruct;
using TestStruct__Version = decltype(static_cast<TestStruct*>(0)->version);

}  // namespace component::middleware::util::binio_test

namespace binio {

#define BINIO_LIST_FIELDS_TestStruct__Version(FLD) \
  FLD(major)                                       \
  FLD(minor)

BINIO_DEF_STRUCT_BUFOBJ(component::middleware::util::binio_test, TestStruct__Version,
                        BINIO_LIST_FIELDS_TestStruct__Version);

#define BINIO_LIST_FIELDS_TestStruct(FLD) \
  FLD(n)                                  \
  FLD(tag)                                \
  FLD(ipv4)                               \
  FLD(version)

BINIO_DEF_STRUCT_BUFOBJ(component::middleware::util::binio_test, TestStruct,
                        BINIO_LIST_FIELDS_TestStruct);

}  // namespace binio
